/**
 * Entity
 * @author hoang.pt
 * @version $Id: NameThread.java 102 2010-08-28 15:50:54Z phantichhoang $
 */

package snippet.theory1;

/**
 * Entity for setName()
 * @author hoang.pt
 */
public class NameThread extends Thread {

    /**
     * Properties
     */
    String name;

    /**
     * constructor
     */
    public NameThread(String x) {
        System.out.println(this.getName());
    }

    /**
     * Method to invoke thread
     * @author hoang.pt
     */
    @Override
    public void run() {
        //super.run();
        int count = 0;
        while (count < 9) {
            Thread.currentThread().setName("Thread " +count);
            name = Thread.currentThread().getName();
            System.out.println(name);
            count ++;
        }
        
    }



}
